dnsmasq: fix start if dhcp-range is not correct
authorFlorian Eckert <[email protected]>
Tue, 29 Apr 2025 13:26:36 +0000 (15:26 +0200)
committerHauke Mehrtens <[email protected]>
Thu, 29 May 2025 21:54:18 +0000 (23:54 +0200)
commitae198c6ba08542d7eaca41103ee86d6794039ffc
treeb68aa1d5712b7ee7572ba34dfc0ab9fef60226c7
parentb90feed6ba7d8437d84fd117ce1a58f00d83806f
dnsmasq: fix start if dhcp-range is not correct

If the uci 'dhcp' configuration for the dhcp leases is incorrect then
the call to 'ipclac' fails. However, the problem is that the dnsmasq
configuration option 'dhcp-range' is still written for this uci section
even though the information generated by ipcalc is incorrect or not set.

Due to the incorrectly generated configuration for dnsmasq, the service
cannot start.

To prevent an incorrect configuration from being written to the configuration,
a check is now made beforehand to ensure that the required variables are
present and valid. If the configuration is incorrect, a message is emitted
to the log that this configuration section is incorrect and this uci
configuration section is omitted.

Signed-off-by: Florian Eckert <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18641
Signed-off-by: Hauke Mehrtens <[email protected]>
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.init